import { http } from "@/utils/http";

/** 部门服务器关联模型定义 */
export type DeptServerModel = {
  id: number;
  deptId: string;
  serverKey: string;
  type?: string;
  remark?: string;
  createdAt: string;
  updatedAt: string;
};

/** 分页获取部门服务器关联列表 */
export const getDeptServerListApi = (data: IReqPagerData) => {
  return http.request<Resp<IRespPagerData<DeptServerModel>>>(
    "get",
    "/dept-server/page-list",
    { params: data }
  );
};

/** 新增部门服务器关联 */
export const addDeptServerApi = (data: Partial<DeptServerModel>) => {
  return http.request<Resp<null>>("post", "/dept-server", { data });
};

/** 删除部门服务器关联 */
export const deleteDeptServerApi = (id: number) => {
  return http.request<Resp<null>>("delete", "/dept-server", {
    params: { id }
  });
};
